<template>	
<!-- v-if="ownerInfo.communityId !== null || ownerInfo.communityId !== undefined ||  ownerInfo.communityId !== ''" -->
	<view class="notice-box"
		>
		<view class="item" v-for="(item,index) in noticeInfo" :key="index" @click="goDetails(item)">
			<view class="img">
				<image :src='item.img' mode="aspectFit"></image>
			</view>
			<view class="conter">
				<view class="title">
					<text>{{item.title}}</text>
					<text>{{item.createTime}}</text>
				</view>
				<view class="text">{{item.text}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex';
	export default {
		name: "notice",
		props: ['noticeInfo'],
		computed: {
		},
		data() {
			return {

			};
		},
		methods: {
			// 跳转详情页
			goDetails(item) {
				uni.navigateTo({
					url: '/pages/home/noticeDetails/noticeDetails?noticeId='+item.noticeId
				})
			},
		}
	}
</script>

<style>
	.notice-box {
		width: 100%;
	}

	.notice-box .item {
		width: 100%;
		background-color: #FFFFFF;
		border-radius: 16rpx;
		box-shadow: 0 2rpx 12rpx rgba(77, 77, 77, .12);
		overflow: hidden;
		margin-bottom: 32rpx;
	}

	.notice-box .item .img {
		width: 100%;
		height: 220rpx;
	}

	.notice-box .item .img image {
		width: 100%;
		height: 100%;
	}

	.notice-box .item .conter {
		padding: 20rpx;
	}

	.notice-box .item .conter .title {
		display: flex;
		align-items: center;
		margin-bottom: 12rpx;
	}

	.notice-box .item .conter .title text:first-child {
		font-size: 28rpx;
		line-height: 40rpx;
		max-width: 400rpx;
		display: -webkit-box ;
		overflow: hidden; /*隐藏溢出的文本  */
		text-overflow: ellipsis;
		word-break: break-all;/*自动换行*/
		-moz-box-orient: vertical; /*从上到下自动排列子元素*/
		-webkit-box-orient: vertical; 
		-webkit-line-clamp:1; /*显示的行数*/
	}

	.notice-box .item .conter .title text:last-child {
		font-size: 24rpx;
		margin-left: auto;
	}

	.notice-box .item .conter .text {
		font-size: 24rpx;
		color: #999BA9;
		display: -webkit-box ;
		overflow: hidden; /*隐藏溢出的文本  */
		text-overflow: ellipsis;
		word-break: break-all;/*自动换行*/
		-moz-box-orient: vertical; /*从上到下自动排列子元素*/
		-webkit-box-orient: vertical; 
		-webkit-line-clamp:2; /*显示的行数*/
	}
</style>
